#include "palette.h"
#include "graphic.h"

#ifndef __Sprite_h__
#define __Sprite_h__


namespace game{
    class Sprite{
        private:
            void initialize(bool screen, Palette* objPalette, Graphic* objGraphic);
                        
            bool screen;
            u8 spriteid;
            Palette* palette;
            Graphic* graphic;
            bool loaded;
            bool dual;
            
            s16 maxFrame;
            s16 frame;
            
            u8 rotset;
            
        public:
            static void dualScreenSpace(s16 space);
            
            Sprite(bool screen, Palette* objPalette, Graphic* objGraphic);
            Sprite(bool screen, Palette* objPalette, Graphic* objGraphic, s16 maxFrame);
            void load(u8 id, s16 x, s16 y);
            void loaddual(u8 id, s16 x, s16 y);
            void remove();
            void reload();
            Sprite* duplicate();
            Sprite* duplicate(bool screen);
            ~Sprite();
            
            u8 getid();
            bool isloaded();
            
            // look & feel
            Graphic* getgraphic();
            void setgraphic(Graphic* objGraphic);
            Palette* getpalette();
            void setpalette(Palette* objPalette);

            //orientation
            bool getvflip();
            void setvflip(bool vflip);
            void flipv();
            bool gethflip();
            void sethflip(bool hflip);
            void fliph();
            void enablerot(u8 rotset);
            void disablerot();
            void setzoomangle(s16 angle, u16 zoomx, u16 zoomy);
            void setzoom(u16 zoomx, u16 zoomy);
            void setangle(s16 angle);
            void setdoublesize(bool dblsize);
            bool getdoublesize();
            
            // location
            void setxy(s16 x, s16 y);
            s16 getx();
            void setx(s16 x);
            s16 gety();
            void sety(s16 y);
            u8 getpriority();
            void setpriority(u8 z);
            
            //animation
            s16 getframe(); 
            void setframe(s16 frame);

            //stylus
            bool isTouched();
            bool isTouched(u8 w, u8 h);
    };
}

#endif
